function [n,fracsPar,aBirth, seismic_error, obs_error, T_cal] = frac_birth(mcmcPar, frac_info, s_error, seisdata, seisPar)

    sigma=mcmcPar.sig;
    measurements=mcmcPar.obs;

    %% -------------- old prior and likelihood -----------------------
    s_error_old=s_error;
    
    prior_old=exp(-s_error_old^2);
   % prior_old=abs(1/s_error_old);
    
    frac_info_old= frac_info;
    apert_old=frac_info_old(1,7);
    n_old = size (frac_info_old, 1);
    [~,fx_old,~]= THERMAID (frac_info,apert_old);  % P_cal [Nt, 3]; T_cal [Nt, 3]
    [d_error_old, log_likeli_old]=Likelihood(fx_old,sigma,measurements);

    %% -------------- new prior and likelihood -----------------------
    
    n_up=randi([1 2]);
    seisPar.num_frac=n_old+n_up;
    seisPar.aperture=apert_old; 

    [frac_info_new, s_error_new] = fracture_generation (seisdata, seisPar);
    n_new = size (frac_info_new, 1);
    
    prior_new=exp(-s_error_new^2);
   %     prior_new=abs(1/s_error_new);
    
    
    apert_new=frac_info_new (1,7);
    [~,fx_new,~]= THERMAID (frac_info_new,apert_new);  % P_cal [Nt, 3]; T_cal [Nt, 3]
    [d_error_new, log_likeli_new]=Likelihood(fx_new,sigma,measurements);

    %% -------------- metropolis judgement --------------------------
    ratio=prior_new/prior_old*exp(log_likeli_new-log_likeli_old)/0.5;  % 0.5 suggest the probability that aperture sampled from -2 to -4; 
    acceptance = min(1,ratio);   

    uB=rand(1);
    if (uB<acceptance)
        n = n_new;
        fracsPar = frac_info_new;
        aBirth=1;
        seismic_error=s_error_new;
        obs_error=d_error_new;
        T_cal=fx_new;
    else
        n = n_old;
        fracsPar = frac_info_old;
        aBirth=0;
        seismic_error=s_error_old;
        obs_error=d_error_old;
        T_cal=fx_old;
    end

end